package org.lpw.wormhole.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.zip.GZIPInputStream;

import org.apache.http.HttpEntity;
import org.apache.http.entity.HttpEntityWrapper;

/**
 * @author lpw
 */
public class HttpGzipEntityWrapper
    extends HttpEntityWrapper
{
    public HttpGzipEntityWrapper(HttpEntity entity)
    {
        super(entity);
    }

    @Override
    public InputStream getContent()
        throws IOException, IllegalStateException
    {
        return new GZIPInputStream(wrappedEntity.getContent());
    }

    @Override
    public long getContentLength()
    {
        return -1;
    }
}
